home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-02-21 | 43.7 KB | 1,141 lines |
- <%@ Language=VBScript CODEPAGE=65001 %>
- <!--#include file="include/wmsConstants.inc"-->
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsConnect.inc"-->
- <!--#include file="include/wmsFileIO.inc"-->
- <!--#include file="include/wmsCommon.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsError.inc"-->
- <!--#include file="include/wmsHeader.inc"-->
- <!--#include file="include/wmsHelp.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: ServerList.asp
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- Dim strOp
- Dim dwLastTabIndex
- Dim bReload
- Dim bEnableAddRemove
- Dim bCredentialsCanBeDelegated
- Dim strGreetingString
- Dim strMeansOfAuthentication
-
- strOp = ""
- dwLastTabIndex = 0
- bReload = FALSE
- bEnableAddRemove = TRUE
- bCredentialsCanBeDelegated = FALSE
-
- Session( "ShowServerList" ) = TRUE
- strMeansOfAuthentication = CStr( Request.ServerVariables( "AUTH_TYPE" ) )
- if( 0 < Len( strMeansOfAuthentication ) ) then
- if( 0 <> StrComp( "Negotiate", strMeansOfAuthentication, vbTextCompare ) ) then
- if( ( 0 = StrComp( "Basic", strMeansOfAuthentication, vbTextCompare ) ) or _
- ( 0 = StrComp( "Kerberos", strMeansOfAuthentication, vbTextCompare ) ) or _
- ( 0 = StrComp( "Digest", strMeansOfAuthentication, vbTextCompare ) ) ) then
- bCredentialsCanBeDelegated = TRUE
- end if
- end if
- end if
-
- if( bCredentialsCanBeDelegated ) then
- strGreetingString = L_SERVERLIST_TEXT
- else
- strGreetingString = L_SERVERLISTSINGLE_TEXT
- bEnableAddRemove = FALSE
- Session( "ShowServerList" ) = FALSE
- end if
-
- InitializeFileIO
- LoadServerList
-
- ' ///////////////////////////////////////////////////////
- '
- ' Parse the query string. If it's empty, we may need to
- ' parse the serverlist.[ xml | txt ] file. We must have an updated
- ' server list and IP list in order to build the contents
- ' of the page.
- '
- strOp = UCase( trim( qs("op") ) )
- if( "" <> strOp ) then
- if( 0 = StrComp( "Proceed", strOp, vbTextCompare ) ) then
- Session( "bShowSSLWarning" ) = FALSE
- PutNamedPreference "RequireSSL", "0"
- if( 0 < Len( qs( "nevershow" ) ) ) then
- PutNamedPreference "NeverShowSSLWarning", "1"
- else
- PutNamedPreference "NeverShowSSLWarning", "0"
- end if
- LoadServerList
- elseif( 0 = StrComp( "DelXML", strOp, vbTextCompare ) ) then
- DeleteServerList
- elseif( 0 = StrComp( "debug", strOp, vbTextCompare ) ) then
- Session( "bShowSSLWarning" ) = TRUE
- Server.Transfer( "/default.asp" )
- end if
- end if
-
- if( "" <> strOp ) then
- if( 0 = StrComp( "ADD", strOp, vbTextCompare ) ) then
- Dim strRequestedServerName
- Dim strResolvedServerName
- strRequestedServerName = CStr( qs( "server" ) )
-
- if( 255 <= Len( strRequestedServerName ) ) then
- strShortenedName = Mid( trim( strRequestedServerName ), 1, 254 )
- Response.Redirect( "server_add.asp?server=" & strShortenedName & "&error=hostnotavailable" & "&helptopic=" & H_SERVERADDHELPTOPIC )
- Response.Flush
- end if
-
- strResolvedServerName = ""
- if( AddServer( strRequestedServerName, strResolvedServerName ) ) then
- bReload = TRUE
- Response.Redirect( "serverlist.asp?extraArg=defeatCaching" )
- else
- if( 0 = StrComp( qs( "onErr" ), "purgeXML", vbTextCompare ) ) then
- DeleteServerList
- if( AddServer( strRequestedServerName, strResolvedServerName ) ) then
- bReload = TRUE
- Response.Redirect( "serverlist.asp?extraArg=defeatCaching" )
- elseif( 0 = StrComp( g_strErrorDescription, "duplicate", vbTextCompare ) ) then
- Response.Redirect( "serverlist.asp?extraArg=defeatCaching" )
- end if
- end if
- Response.Redirect( "server_add.asp?server=" & strRequestedServerName & "&error=" & g_strErrorDescription & "&helptopic=" & H_SERVERADDHELPTOPIC )
- end if
- elseif( 0 = StrComp( "REMOVE", strOp, vbTextCompare ) ) then
- RemoveServerFromHash( qs( "hashkey" ) )
- RemoveServerByIndex( CInt( qs( "server" ) ) )
- end if
- end if
-
- if TRUE = bReload then %>
- <%
- WriteHTMLHeader( L_WMSWEBADMINTITLE_TEXT ) %>
- <script language="JavaScript">
- <!--
- /*@cc_on @*/
-
- ///////////////////////////////////////////////////////////////////////////
- function Reload()
- {
- document.location.replace( "serverlist.asp?show=<%= RemoveDangerousCharacters( qs("show") ) %>" );
- }
-
- ///////////////////////////////////////////////////////////////////////////
- function MakeSureImFramed()
- {
- <% jsTRY %>
- <%
- if( brMSIE = g_dwBrowserType ) then %>
- if( window.parent.top )
- {
- window.parent.top.name="sList";
- }
- else
- {
- window.name="sList";
- }
-
- if( document.location == window.parent.top.location )
- {
- window.parent.top.location.replace( "/wmssecure/index.asp?show=<%= RemoveDangerousCharacters( qs("show") ) %>" );
- }
- <% else %>
- if( parent )
- {
- parent.document.name="sList";
- }
- else
- {
- window.name="sList";
- }
-
- if( document.location == parent.document.location )
- {
- parent.document.location.replace( "/wmssecure/index.asp?show=<%= RemoveDangerousCharacters( qs("show") ) %>" );
- }
-
- <%
- end if %>
- <% jsCATCH %>
- }
- -->
- </script>
- </head>
- <body
- oncontextmenu="JavaScript:event.cancelBubble=true;return false;"
- topmargin="0"
- leftmargin="0"
- rightmargin="0"
- marginwidth="0"
- marginheight="0"
- onload="JavaScript:MakeSureImFramed();Reload();"
- bgcolor="#6699ff">
- </body>
- </html>
- <%
- Response.Flush
- Response.End
- end if
-
- '///////////////////////////////////////////////////////////////////////////
- '
- ' Purge the XML file
- '
- Function DeleteServerList
- if( g_FileSysObj.FileExists( g_strXMLPath ) ) then
- g_FileSysObj.DeleteFile( g_strXMLPath )
- CreateNewServerListFile
- end if
- End Function
-
- '///////////////////////////////////////////////////////////////////////////
- '
- ' Add the server to the in-memory name and IP address arrays
- '
- Function AddServer( strRequestedServerName, ByRef strResolvedServerName )
- Dim strIPAddress
- Dim bIsRawIPAddress
- Dim iIP
- Dim i
- Dim bNameExists
- Dim dwNumServersInList
- Dim strEntry
- Dim dwConnectionFailureCode
-
- if( 255 <= Len( strRequestedServerName ) ) then
- dwConnectionFailureCode = WMS_SERVER_UNKNOWN
- g_strErrorDescription = "hostnotavailable"
- AddServer = FALSE
- Exit Function
- end if
-
- ' validate args
- strRequestedServerName = SafeUnescape( Trim( strRequestedServerName ) )
- strResolvedServerName = strRequestedServerName
-
- if( 0 >= Len( strResolvedServerName ) ) then
- AddServer = FALSE
- exit function
- end if
-
- dwConnectionFailureCode = WMS_SERVER_UNKNOWN
- bIsRawIPAddress = FALSE
-
- strResolvedName = ""
-
- on error goto 0
- bIsRawIPAddress = LooksLikeIPv4( strResolvedServerName )
- if( FALSE = bIsRawIPAddress ) then
- bIsRawIPAddress = LooksLikeIPv6( strResolvedServerName )
- end if
- err.clear
- if( bIsRawIPAddress ) then
- if( 0 = StrComp( strResolvedServerName, Application( "strHostIPAddress" ), vbTextCompare ) ) then
- strResolvedServerName = g_strLocalHostName
- else
- strIPAddress = strResolvedServerName
- on error resume next
- strResolvedName = s_WMSAdmin.MachineName( strResolvedServerName )
- if( 0 < Len( strResolvedName ) ) then
- strResolvedServerName = strResolvedName
- if( 0 < InStr( strResolvedServerName, "." ) ) then
- '
- ' it's safest to use the full router name if an IP address was specified
- '
- ' strResolvedServerName = GetLongServerName( strResolvedName )
- strResolvedServerName = GetShortServerName( strResolvedName )
- end if
- end if
- end if
- else
- on error resume next
- strIPAddress = s_WMSAdmin.ResolveToIP( strResolvedServerName )
- end if
-
- if( 0 <> err.number ) then
- ' Session( "dbg" ) = err.number & " " & strResolvedServerName
- g_strErrorDescription = "hostnotavailable"
- AddServer = FALSE
- exit function
- end if
-
- ' Ping the remote server to see if the machine and WMS service exists
- dwConnectionFailureCode = s_WMSAdmin.GetServiceStatus( strResolvedServerName )
-
- if( WMS_HOST_UNAVAILABLE = dwConnectionFailureCode ) then
- g_strErrorDescription = "hostnotavailable"
- AddServer = FALSE
- exit function
- elseif( WMS_SERVICE_UNAVAILABLE = dwConnectionFailureCode ) then
- g_strErrorDescription = "nowms"
- AddServer = FALSE
- exit function
- elseif( WMS_SERVICE_INERROR = dwConnectionFailureCode ) then
- g_strErrorDescription = "serviceerror"
- AddServer = FALSE
- exit function
- end if
-
- Dim objServer
- objServer = empty
-
- if( WMS_SERVICE_STARTED = dwConnectionFailureCode ) then
- call ConnectToNamedServer( strResolvedServerName, "connect", objServer )
- if( empty = objServer ) then
- g_strErrorDescription = "nocred"
- AddServer = FALSE
- Exit Function
- end if
-
- objServer = empty
-
- if( 0 = StrComp( g_strLocalHostIP, strIPAddress, vbTextCompare ) ) then
- strResolvedServerName = g_strLocalHostName
- end if
- else
- end if
-
- Dim bRetVal
- Dim strErrString
- bRetVal = AddServerToXMLDOM( strResolvedServerName, strIPAddress, strErrString )
- if( FALSE = bRetVal ) then
- g_strErrorDescription = strErrString
- if( 0 = Len( g_strErrorDescription ) ) then
- g_strErrorDescription = "E_FAIL"
- end if
- end if
- AddServer = bRetVal
-
- End Function
-
-
- '////////////////////////////////////////////////////////////////
- '
- ' If you want to see short NetBios names, then ask the Windows Media Server
- '
- Function GetShortServerName( strServerLongName )
- if( 255 <= Len( strServerLongName ) ) then
- GetShortServerName = ""
- Exit Function
- end if
-
- on error resume next
- GetShortServerName = strServerLongName
- if( WMS_SERVICE_STOPPED < s_WMSAdmin.GetServiceStatus( strServerLongName ) ) then
- set objWMServer = s_WMSAdmin.Connect( strServerLongName )
- GetShortServerName = objWMServer.Name
- end if
- End Function
-
-
- '////////////////////////////////////////////////////////////////
- '
- ' If you want to see fully qualified names, then try using ADSI
- '
- Function GetLongServerName( strServerName )
- on error resume next
- GetLongServerName = strServerName
-
- ' do not use Server.CreateObject, here
- Set objServer = CreateObject( "WMSServer.Server", strServerName )
- Set objComputer = GetObject( "WinNT://" & strServerName & ",computer" )
- GetLongServerName = objComputer.Name
- End Function
-
-
- '////////////////////////////////////////////////////////////////
- Function SpacesToNonbreak( strStringToChange )
- temp = strStringToChange
- x = InStr( temp, " ")
- Do While( x > 0 )
- SpacesToNonbreak = SpacesToNonbreak & Left( temp, x-1 )
- SpacesToNonbreak = SpacesToNonbreak & " "
- temp = Mid( temp, x+1 )
- x = InStr( temp, " " )
- Loop
-
- SpacesToNonbreak = SpacesToNonbreak + temp
- End Function
-
- '////////////////////////////////////////////////////////////////
- '
- ' Generate the server list to be diplayed on the serverlist page
- ' We could use an XSL transform instead
- '
- Sub RenderServerList()
- Dim i
- Dim dwNumServers
- Dim dwNumServersAddedToList
- Dim strEachServerName
- Dim strServerIP
- dwNumServersAddedToList = 0
- on error goto 0
-
- LoadServerList
- dwNumServers = g_dwNumAvailableServers
- bCheckedAnItem = FALSE
-
- %>
- <table align="left" width="550" cellspacing="4" cellpadding="2" border="0" margin-bottom="0" margin-top="0" valign="middle">
- <%
- if( FALSE = bCredentialsCanBeDelegated ) then
- strHashedName = ServerNameToHashKey( g_strLocalHostName, TRUE ) %>
- <tr>
- <td class="serverlistOdd" colspan=2>
- <input
- type="radio"
- name="Server"
- id="<%= g_strLocalHostName %>"
- hashkey="<%= strHashedName %>"
- align="left"
- tabindex="<%= dwLastTabIndex %>"
- value=""
- checked>
- <a
- href="JavaScript:OpenBrowserWindow( '<%= strHashedName %>', '<%= Server.HTMLEncode( strServerName ) %>' );"
- class="serverlistOdd"
- <% if( FALSE = g_bLocalHostRunningWMS ) then %> style="color:gray" <% end if %>
- oncontextmenu="JavaScript:event.cancelBubble=true;return false;"
- tabindex="<%= dwLastTabIndex + 1 %>"
- onmouseover="JavaScript:window.status='<%= RemoveDangerousCharacters( g_strLocalHostName ) %>';return true;"
- onmouseout="JavaScript:window.status='';"
- ><%= g_strLocalHostName %><br>
- </a>
- </td>
- </tr>
- <% else
- dwLastTabIndex = 4
- for i = 0 to ( dwNumServers - 1 )
- bSuccess = GetServerNameAndIPByIndex( i, strEachServerName, strServerIP )
- if( bSuccess ) then
- if( 0 = StrComp( "localhost", strEachServerName, vbTextCompare ) ) then
- if( 0 >= Len( g_strLocalHostName ) ) then
- g_strLocalHostName = Application( "bLocalHostHasWMS" )
- end if
- strEachServerName = g_strLocalHostName
- end if
- end if
-
- strHashedName = ServerNameToHashKey( strEachServerName, TRUE )
- %>
- <tr>
- <td class="serverlist<% if 0 = dwNumServersAddedToList mod 2 then %>Odd<% else %>Even<% end if%>" colspan=2>
- <input
- type="radio"
- name="Server"
- id="<%= strEachServerName %>"
- hashkey="<%= strHashedName %>"
- align="left"
- tabindex="<%= dwLastTabIndex %>"
- value=""<%
- if ( ( 0 = i ) and ( "" = CStr( qs("server") ) ) ) or _
- ( 0 = StrComp( Server.URLEncode( strEachServerName ), Server.URLEncode( qs("server") ), vbTextCompare ) ) or _
- ( ( i = ( dwNumServers - 1 ) ) and ( not bCheckedAnItem ) ) then
- Response.Write( " checked " )
- bCheckedAnItem = TRUE
- end if %> >
- <a
- class="serverlist<% if 0 = dwNumServersAddedToList mod 2 then %>Odd<% else %>Even<% end if%>"
- <% if bSuccess then %>
- href="JavaScript:OpenBrowserWindow( '<%= strHashedName %>', '<%= Server.HTMLEncode( strEachServerName ) %>' );"
- <% else %>
- style="cursor:default;color:red"
- <% end if %>
- oncontextmenu="JavaScript:event.cancelBubble=true;return false;"
- tabindex="<%= dwLastTabIndex + 1 %>"
- onmouseover="JavaScript:window.status='<%= RemoveDangerousCharacters( strEachServerName ) %>';return true;"
- onmouseout="JavaScript:window.status='';"
- ><%
- if bSuccess then
- Response.Write( Server.HTMLEncode( strEachServerName ) )
- else
- Response.Write( Server.HTMLEncode( replace( L_SERVERNOTFOUND_TEXT, "___", strEachServerName ) ) )
- end if %><br>
- </a>
- </td>
- </tr><%
- dwNumServersAddedToList = dwNumServersAddedToList + 1
- dwLastTabIndex = dwLastTabIndex + 2
- next
- end if
-
- if( 0 = dwNumServersAddedToList )then
- %>
- <tr>
- <td colspan=2>
- <center>
- <span
- tabindex=<%= dwLastTabIndex %>
- class="defaultcursor"
- <%
- if bCredentialsCanBeDelegated then
- if( 0 = StrComp( "accessDenied", g_strErrorDescription, vbTextCompare ) ) then %>
- <a href="JavaScript:ReplaceXMLFile();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
- <span class="warntext" style="cursor:hand" onClick="JavaScript:void( 0 );">
- <%= Server.HTMLEncode( L_ACCESSDENIED_TEXT ) %>
- </span>
- </a>
- <%
- elseif ( 0 = StrComp( "badXML", g_strErrorDescription, vbTextCompare ) ) then %>
- <a href="JavaScript:ReplaceXMLFile();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
- <span class="warntext" style="cursor:hand" onClick="JavaScript:ReplaceXMLFile();">
- <%= Server.HTMLEncode( L_BADXMLLINK_TEXT ) %>
- </span>
- </a>
- <%
- else
- %>
- onClick="JavaScript:document.location.replace( 'server_add.asp<%= "?helptopic=" & H_SERVERADDHELPTOPIC %>' );">
- <a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:document.location.replace( 'server_add.asp<%= "?helptopic=" & H_SERVERADDHELPTOPIC %>' );">
- <span class="warntext" style="cursor:hand"><%= Server.HTMLEncode( L_ADDSERVERS_TEXT ) %></span>
- </a><%
- end if
- end if %>
- </span>
- </center>
- </td>
- </tr><%
- end if %>
- </table>
- <%
- End Sub
-
- on error goto 0
- '///////////////////////////////////////////////////////////////////////////
- function LooksLikeIPv6( strPotentialIPAddress )
- on error goto 0
- if( 0 < InStr( strPotentialIPAddress, "." ) ) then
- if( 0 < InStr( strPotentialIPAddress, ":" ) ) then
- LooksLikeIPv6 = TRUE
- exit function
- end if
- end if
-
- LooksLikeIPv6 = FALSE
- end function
-
- '///////////////////////////////////////////////////////////////////////////
- function LooksLikeIPv4( strPotentialIPAddress )
-
- Dim strServerName
- Dim dwNumDots
- Dim strCollectedInt
- Dim x
-
- strServerName = strPotentialIPAddress
- dwNumDots = 1
-
- x = InStr( strServerName, "." )
-
- if( 0 = x ) then
- LooksLikeIPv4 = FALSE
- exit function
- end if
-
- temp = Mid( strServerName, 1, x - 1 )
- strCollectedInt = strCollectedInt & temp
- strServerName = Mid( strServerName, x + 1, len( strServerName ) - x )
- x = InStr( strServerName, "." )
-
- Do While( x > 0 )
- temp = Mid( strServerName, 1, x - 1 )
- strCollectedInt = strCollectedInt & temp
- strServerName = Right( strServerName, len( strServerName ) - x )
-
- dwNumDots = dwNumDots + 1
- if( dwNumDots > 4 ) then
- LooksLikeIPv4 = FALSE
- exit function
- end if
- x = InStr( strServerName, "." )
- Loop
-
- strCollectedInt = strCollectedInt & strServerName
-
- if( dwNumDots <> 3 ) then
- LooksLikeIPv4 = FALSE
- exit function
- end if
-
- if( FALSE = IsNumeric( strCollectedInt ) ) then
- LooksLikeIPv4 = FALSE
- exit function
- end if
-
- LooksLikeIPv4 = TRUE
-
- end function
-
- '///////////////////////////////////////////////////////////////////////////
- WriteHTMLHeader( L_WMSWEBADMINTITLE_TEXT ) %>
- <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
- <script language="JavaScript" src="include/WMSCommon.js"></script>
- <script language="JavaScript">
- <!--
- /*@cc_on @*/
- var g_bLogOffClickHandled = false;
- var g_bInitialized = false;
- var g_strLastElement = new String("");
-
- <% WriteCommonJSUtils %>
-
- ///////////////////////////////////////////////////////////////////////
- function ShowSecurity()
- {
- <% jsTRY %>
- var win;<%
- strLocalHostWinName = Session( "LocalHostWinName" )
- if( 0 >= Len( strLocalHostWinName ) ) then
- strLocalHostWinName = Request.QueryString( "server" )
- Session( "LocalHostWinName" ) = strLocalHostWinName
- end if
- %>
- var szUrl = new String( "/default.asp?lhwn=<%= strLocalHostWinName %>" );
- var szFeatures = "";
- win = window.open( szUrl, "sList", szFeatures, true );
- if( win )
- {
- win.focus();
- }
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////////
- function ReplaceXMLFile()
- {
- <% jsTRY %>
- document.location.replace( "serverlist.asp?op=DelXML" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function DotsToUnderscores( szInput )
- {
- var szOutput;
- <% jsTRY %>
- var i;
- var rgSpaceBreaks;
-
- if( null == szInput )
- {
- return( null );
- }
-
- szOutput = "";
-
- // Filter out encoded space chars
- szInput = SafeUnescape( szInput );
- rgSpaceBreaks = szInput.split( "." );
- for( i = 0; i < rgSpaceBreaks.length; i++ )
- {
- if( rgSpaceBreaks[ i ] != "" )
- {
- szOutput = szOutput + rgSpaceBreaks[ i ];
- if( i < rgSpaceBreaks.length - 1 )
- {
- szOutput = szOutput + '_';
- }
- }
- }
-
- szInput = szOutput;
- <% jsCATCH %>
- return( szOutput );
- }
-
- ///////////////////////////////////////////////////////////////////////
- function OpenBrowserWindow( strHashedName, strServerName )
- {
- var win = null;
- var szFeatures = "hotkeys,scrollbars,status,menubar,resizable"; //,location";
- var bReplace = true;
- var szUrl;
-
- <% jsTRY %>
- if( strHashedName )
- {
- <% if brMSIE = g_dwBrowserType then %>
- window.MainDiv.style.cursor="Wait";
- <% end if %>
- <% if( TRUE or bCredentialsCanBeDelegated ) then %>
- szUrl = "admin.asp?server=" + strHashedName + "&showSL=true";
- <% end if %>
-
- win = window.open( szUrl, strHashedName, szFeatures, true );
- if( ! win )
- {
- win = window.open( szUrl, strHashedName, szFeatures, true );
- }
-
- if( win )
- {
- <% jsTRY %>
- win.focus();
- <% jsCATCH %>
- win.name = strHashedName;
- }
- else
- {
- window.alert( "<%= RemoveDangerousCharacters( L_UNSPECIFIEDERROR_TEXT ) %>" );
- }
- }
- <% if( brMSIE = g_dwBrowserType ) then %>
- window.MainDiv.style.cursor="Auto";
- <% end if %>
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function GetCheckedItemIndex()
- {
- <% jsTRY %>
- var i;
- var e;
-
- //if length is defined, iterate over the elements
- if( document.forms.servers.length )
- {
- for( i = 0; i < document.forms.servers.length; i++ )
- {
- e = document.forms.servers[ i ];
- if ( e.checked )
- {
- return i;
- }
- }
- //length isn't defined, so there's only the dummy element
- }
- <% jsCATCH %>
- return null;
- }
-
- ///////////////////////////////////////////////////////////////////////
- function GetCheckedItem()
- {
- <% jsTRY %>
- var i;
- var e;
-
- //if length is defined, iterate over the elements
- if( document.forms.servers.length )
- {
- for( i = 0; i < document.forms.servers.length; i++ )
- {
- e = document.forms.servers[ i ];
- if ( e.checked )
- {
- return( e.id );
- }
- }
- //length isn't defined, so there's only the dummy element
- }
- <% jsCATCH %>
- return null;
- }
-
- ///////////////////////////////////////////////////////////////////////
- function GetCheckedItemHashKey()
- {
- <% jsTRY %>
- var i;
- var e;
-
- //if length is defined, iterate over the elements
- if( document.forms.servers.length )
- {
- for( i = 0; i < document.forms.servers.length; i++ )
- {
- e = document.forms.servers[ i ];
- if ( e.checked )
- {
- return( e.getAttribute( "hashkey" ) );
- }
- }
- //length isn't defined, so there's only the dummy element
- }
- <% jsCATCH %>
- return null;
- }
-
- ///////////////////////////////////////////////////////////////////////
- function RemoveServer()
- {
- <% jsTRY %>
- var strServerName;
- var dwSelectedServer;
- var dwSelectedServerHashKey;
- var strRemoveString;
-
- dwSelectedServer = GetCheckedItemIndex();
- szSelectedServer = GetCheckedItem();
- dwSelectedServerHashKey = GetCheckedItemHashKey();
-
- if( ( 0 > dwSelectedServer ) || ( <%= g_dwNumAvailableServers %> <= dwSelectedServer ) )
- {
- window.alert( "<%= RemoveDangerousCharacters( L_SPECIFYSERVER_TEXT ) %>" );
- return;
- }
-
- strRemoveString = new String( "<%= RemoveDangerousCharacters( L_CONFIRMSERVERREMOVE_TEXT ) %>" );
- strRemoveString = strRemoveString.replace( /___/i, szSelectedServer );
- if( true == window.confirm( strRemoveString ) )
- {
- document.location.replace( "serverlist.asp?op=remove&server=" + dwSelectedServer + "&hashkey=" + dwSelectedServerHashKey );
- }
- <% jsCATCH %>
- return;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- function MakeSureImFramed()
- {
- <% jsTRY %>
- <% if( brMSIE = g_dwBrowserType ) then %>
- if( window.parent.top )
- {
- window.parent.top.name="sList";
- }
- else
- {
- window.name="sList";
- if( window.top )
- {
- window.top.name="sList";
- }
- }
-
- if( document.location == window.parent.top.location )
- {
- window.parent.top.location.replace( "/wmssecure/index.asp?show=<%= RemoveDangerousCharacters( qs("show") ) %>" );
- }
- <% else %>
- if( parent )
- {
- parent.document.name="sList";
- }
- else
- {
- window.name="sList";
- }
-
- if( document.location == parent.document.location )
- {
- parent.document.location.replace( "/wmssecure/index.asp?show=<%= RemoveDangerousCharacters( qs("show") ) %>" );
- }
- <% end if %>
- <% jsCATCH %>
- }
-
- function LoadNonsecurePage()
- {
- <% jsTRY %>
- document.location.replace( "/default.asp?show=true" );
- <% jsCATCH %>
- }
-
- function LoadHandler()
- {
- <% jsTRY %>
- <% if brNetscape = g_dwBrowserType then %>
- window.zlock = true;
- <% else %>
- window.MainDiv.style.cursor = "Auto";
- <% end if %>
- window.focus();
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function Logoff()
- {
- <% jsTRY %>
- if( g_bLogOffClickHandled )
- {
- return;
- }
-
- if( ! window.confirm( "<% if( TRUE = Session( "ShowServerList" ) ) then Response.Write( RemoveDangerousCharacters( L_LOGOFFSLCONF_TEXT ) ) else Response.Write( RemoveDangerousCharacters( L_LOGOFFCONF_TEXT ) ) end if %>" ) )
- {
- return;
- }
-
- g_bLogOffClickHandled = true;
- TellSessionFrameToAbandon();
- var szFeatures = "";
- var szUrl = "";
- var winHelp = window.open( szUrl, "HELP", szFeatures, true );
- window.focus();
- if( winHelp )
- {
- winHelp.close();
- }
- window.focus();
- window.parent.parent.parent.location.replace( document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + "/WMSLogOff.asp?terminate=1&close=1" );
- <% jsCATCH %>
- }
-
- ///////////////////////////////////////////////////////////////////////
- function TellSessionFrameToAbandon()
- {
- <% jsTRY %>
- if( window.location == window.parent.location )
- {
- return;
- }
-
- var sessionFrame = null;
- if( window.parent && window.parent.frames )
- {
- sessionFrame = parent.frames[ "WMSSession" ];
- }
-
- if( sessionFrame )
- {
- sessionFrame.location.replace( sessionFrame.location + "&logoff=true" );
- return;
- }
- <% jsCATCH %>
- }
- -->
- </script>
- <STYLE>
- A:link
- {
- color: #6699FF;
- font-style: normal;
- font-family: Tahoma, Arial, Helvetica, sans-serif
- }
- A:visited
- {
- color: #6699FF;
- font-style: normal;
- font-family: Tahoma, Arial, Helvetica, sans-serif
- }
- A:hover
- {
- color: #FF0000;
- font-style: normal;
- font-family: Tahoma, Arial, Helvetica, sans-serif
- }
- Body
- {
- font-family: Tahoma, Arial, Helvetica, sans-serif;
- font-weight: normal;
- font-style: normal;
- color: Black;
- background-color: #6699FF;
- margin-left: 0;
- margin-right: 0;
- margin-top: 0;
- margin-bottom: 0;
- margin: 0
- }
- </STYLE>
- </head>
- <body
- bgcolor="#6699FF"
- topmargin="0"
- leftmargin="0"
- rightmargin="0"
- bottommargin="0"
- marginwidth="0"
- marginheight="0"
- nowrap
- onload="JavaScript:MakeSureImFramed();LoadHandler();"
- oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
- <div id="MainDiv">
- <form name="servers">
- <table bgcolor="#6699FF" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse" height="100%" width="100%"><tr><td><%'
- <!-- Main Container Table --> %>
- <table width="760" bgcolor="#6699FF" class="splashtable" align="center" valign="middle" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse" width="100%">
- <tr height="1" align="left"><td bgcolor="gray" width="760" height="1"></td></tr>
- <tr align="left">
- <td>
- <table align="left" background="img/wms_asp_intro_bkgd_slice_01.gif" no-repeat class="splashtable" height="150" width="760" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse" margin-bottom="0" margin-top="0">
- <tr valign="top">
- <!-- User WMSspacer.gif to lay out the Admin text and instructions in relation to branding -->
- <td align="right" valign="top" colspan="2">
- <table border="0" cellspacing="0" cellpadding="0" border="0">
- <tr valign="top">
- <td valign="top">
- <img src="img/WMSspacer.gif" width="60" height="110" border="0" alt="">
- <span class="admintext" nowrap>
- <%= SpacesToNonbreak( Server.HTMLEncode( L_ADMIN_TEXT ) ) %>
- </span>
- </td>
- <td align="right" width="80">
- <img src="img/WMSspacer.gif" width="80" height=110 border="0" alt="">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td align="left" valign="bottom" width="150">
-
- </td>
- <td align="left" valign="bottom">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <img src="img/WMSspacer.gif" height=10 border="0" alt=""><span class="helptext"><%= strGreetingString %></span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr align="left">
- <td>
- <table align="left" class="splashtable" width="760" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse" margin-bottom="0" margin-top="0">
- <tr valign="top">
- <td background="img/wms_asp_intro_bkgd_slice_04.gif" height="255" no-repeat margin-top="0" width="150" valign="top" nowrap>
- <!-- Nested Table for Toolbar Style Buttons-->
- <table align="left" width="150" cellspacing="6" cellpadding="4" border="0" margin-bottom="0" margin-top="0" valign="top"><%
- if( bEnableAddRemove ) then
- if( 0 < Len( g_strErrorDescription ) ) then
- if( 0 = StrComp( g_strErrorDescription, "accessDenied", vbTextCompare ) ) or _
- ( 0 = StrComp( g_strErrorDescription, "badXML", vbTextCompare ) ) then
- bEnableAddRemove = FALSE
- end if
- end if
- end if
- %>
- <% if( FALSE = bEnableAddRemove ) then %>
- <tr align="center"><td style="font-weight:600"><span style="cursor:default" disabled tabindex=1><img src="img/ServerAdd_disabled_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_ADDSERVERALT_TEXT ) %>"><br><%= SpacesToNonbreak( L_ADDSERVER_TEXT ) %></span></td></tr>
- <tr align="center"><td style="font-weight:600"><span style="cursor:default" disabled tabindex=2><img src="img/ServerRemove_disabled_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_REMOVESERVERALT_TEXT ) %>"><br><%= SpacesToNonbreak( L_REMOVESERVER_TEXT ) %></span></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:DoHelp('/','<%= H_SERVERLISTHELPTOPIC %>');" tabindex=3><img src="img/Help_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_HELPBUTTONALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_HELP_TEXT ) ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:Logoff();" tabindex=3><img src="/img/WMSLogoff_32.jpg" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_LOGOFFALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_LOGOFFBTN_TEXT ) ) %></a></td></tr>
- <% elseif ( 0 = g_dwNumAvailableServers ) or ( FALSE = g_bServerlistFileExists ) then %>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:document.location.replace( 'server_add.asp<%= "?helptopic=" & H_SERVERADDHELPTOPIC %>' );" tabindex=1><img src="img/ServerAdd_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_ADDSERVERALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_ADDSERVER_TEXT ) ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><span style="cursor:default" disabled tabindex=2><img src="img/ServerRemove_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( H_SERVERREMOVEHELPTOPIC ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_REMOVESERVER_TEXT ) ) %></span></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:DoHelp('/','<%= H_SERVERLISTHELPTOPIC %>');" tabindex=3><img src="img/Help_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_HELPBUTTONALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_HELP_TEXT ) ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:Logoff();" tabindex=3><img src="/img/WMSLogoff_32.jpg" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_LOGOFFALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_LOGOFFBTN_TEXT ) ) %></a></td></tr>
- <% else %>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:document.location.replace( 'server_add.asp<%= "?helptopic=" & H_SERVERADDHELPTOPIC %>' );" tabindex=1><img src="img/ServerAdd_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_ADDSERVERALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_ADDSERVER_TEXT ) ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:RemoveServer();" tabindex=2><img src="img/ServerRemove_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_REMOVESERVERALT_TEXT ) %>"><br><%= SpacesToNonbreak( L_REMOVESERVER_TEXT ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:DoHelp('/','<%= H_SERVERLISTHELPTOPIC %>');" tabindex=3><img src="img/Help_32.gif" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_HELPBUTTONALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_HELP_TEXT ) ) %></a></td></tr>
- <tr align="center"><td style="font-weight:600"><a oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:Logoff();" tabindex=3><img src="/img/WMSLogoff_32.jpg" width="32" height="32" border="0" alt="<%= Server.HTMLEncode( L_LOGOFFALT_TEXT ) %>"><br><%= SpacesToNonbreak( Server.HTMLEncode( L_LOGOFFBTN_TEXT ) ) %></a></td></tr>
- <% end if %>
- </table>
- </td>
- <td background="img/wms_asp_intro_content.gif" no-repeat width="610" nowrap>
- <!-- Nested Table for Server List -->
- <% RenderServerList() %>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr align="center" valign="top">
- <td>
- <table align="center" valign="top" class="splashtable" width="760" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;" margin-bottom="0" margin-top="0">
- <tr valign="top">
- <td bgcolor="gray" colspan="2" height="1"></td>
- </tr>
- <tr>
- <td background="img/wms_asp_intro_bottomstrip.gif" no-repeat colspan="2" height="24" width="760" valign="top" nowrap>
- <table align="top" valign="top" cellspacing="0" cellpadding="0" border="0" margin-bottom="0" margin-top="0">
- <tr>
- <td align="left">
- <% if not g_bSecureConnection then %>
- <table cellspacing="0" cellpadding="0" height="24" width="100%" hspace="0" vspace="0" ID="Table1">
- <tr valign="middle">
- <td>
- <table cellpadding="1" cellspacing="0" border="0" ID="Table2">
- <tr>
- <td>
-
- </td>
- <td nowrap align="absmiddle">
- <a href="JavaScript:LoadNonsecurePage();">
- <img border="0" valign="middle" height="24" width="24" alt="<%= Server.HTMLEncode( L_NONSECWARN_TEXT ) %>" src="img/not_secure_24.gif">
- </a>
- </td>
- <td>
- <span class="defaultcursor"> </span>
- </td>
- <td nowrap valign="middle">
- <span title="<%= Server.HTMLEncode( L_NONSECWARN_TEXT ) %>" onClick="JavaScript:LoadNonsecurePage();" class="warntext" style="cursor:hand" id="nonsecure" valign="middle" href="http://<%= Request.ServerVariables( "HTTP_HOST" ) %>/default.asp" target="sList" border="0">
- <% if ( brMSIE <> Session( "BrowserType" ) ) then %><a class="warntext" style="cursor:hand" oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:ShowSecurity();"><font color="#ff0000"><% end if %><%= Server.HTMLEncode( L_NONSECWARNALT_TEXT ) %><% if( brMSIE <> Session( "BrowserType" ) ) then %></font></a><% end if %>
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <% else %>
- <table cellspacing="0" cellpadding="0" height="24" width="100%" hspace="0" vspace="0" ID="Table3">
- <tr valign="middle">
- <td>
- <table cellpadding="1" cellspacing="0" border="0">
- <tr>
- <td>
-
- </td>
- <td nowrap align="absmiddle">
- <a href="JavaScript:ShowSecurity();">
- <img border="0" valign="middle" height="24" width="24" alt="<%= Server.HTMLEncode( L_SECURECONNECTION_TEXT ) %>" src="img/secure_24.gif">
- </a>
- </td>
- <td>
- <span class="defaultcursor"> </span>
- </td>
- <td nowrap valign="middle">
- <span title="<%= Server.HTMLEncode( L_SECURECONNECTION_TEXT ) %>" onClick="JavaScript:LoadNonsecurePage();" class="warntext" style="cursor:hand;color:black" valign="middle" href="http://<%= Request.ServerVariables( "HTTP_HOST" ) %>/default.asp" target="sList" border="0">
- <% if ( brMSIE <> Session( "BrowserType" ) ) then %><a class="warntext" style="cursor:hand;color:black" oncontextmenu="JavaScript:event.cancelBubble=true;return false;" href="JavaScript:ShowSecurity();"><font color="#ff0000"><% end if %><%= Server.HTMLEncode( L_SECURECONNECTION_TEXT ) %><% if( brMSIE <> Session( "BrowserType" ) ) then %></font></a><% end if %>
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <% end if %>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td bgcolor="gray" colspan="2" height="1"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td></tr></table>
- </form>
- </div>
- </body>
- </html>
- <%
- ' Cleanup
- on error resume next
- strOp = empty
- dwLastTabIndex = empty
- bReload = empty
- bEnableAddRemove = empty
- bCredentialsCanBeDelegated = empty
- strGreetingString = empty
- strMeansOfAuthentication = empty
-
- on error resume next
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
- WMSFileIOASPCleanup
- %>
-